<template>
  <div id="botnav">
    <van-tabbar v-model="active" active-color="#ee0a24" inactive-color="#000" >
      <van-tabbar-item icon="home-o" to="/home" >商城</van-tabbar-item>
      <van-tabbar-item icon="apps-o" to="/items">分类</van-tabbar-item>
      <van-tabbar-item icon="cart-o" to="/cart">购物车</van-tabbar-item>
      <van-tabbar-item icon="manager-o" to="/my" v-if="flag">我的</van-tabbar-item>
      <van-tabbar-item icon="manager-o" to="/my" v-else>未登录</van-tabbar-item>
      <!-- <van-tabbar-item icon="manager-o" to="/login" v-show="!localStorage.getItem('info')">未登录</van-tabbar-item> -->
    </van-tabbar>
  </div>
</template>


<script>
export default {
  data() {
    return {
      active: 0,
      flag:localStorage.getItem('info')?true:false
    };
  },
  mounted(){
    this.active=this.$route.meta.active;
    // this.$router.go(0)
  }
};
</script>


<style  lang="less">
#botnav {
  width: 7.5rem;
  .van-hairline--top-bottom {
    width: 7.5rem;
  }
}
.van-tabbar-item {
  font-size: 0.2rem;
}
.van-tabbar-item__icon {
  font-size: 0.25rem;
}
</style>